using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._3DFeatures._Extraction
{
    /// <summary>
    /// <para>Regularize Adjacent Building Footprint</para>
    /// <para>Regularizes building footprints that have common boundaries.</para>
    /// <para>规范具有共同边界的建筑物覆盖区。</para>
    /// </summary>    
    [DisplayName("Regularize Adjacent Building Footprint")]
    public class RegularizeAdjacentBuildingFootprint : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RegularizeAdjacentBuildingFootprint()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input features to process.</para>
        /// <para>要处理的输入要素。</para>
        /// </param>
        /// <param name="_group">
        /// <para>Grouping Field</para>
        /// <para>The field that will be used to determine which features share coincident, non-overlapping boundaries.</para>
        /// <para>将用于确定哪些要素共享重合、非重叠边界的字段。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be produced.</para>
        /// <para>将生成的要素类。</para>
        /// </param>
        public RegularizeAdjacentBuildingFootprint(object _in_features, object _group, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._group = _group;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "Regularize Adjacent Building Footprint";

        public override string CallName => "3d.RegularizeAdjacentBuildingFootprint";

        public override List<string> AcceptEnvironments => ["geographicTransformations", "outputCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_in_features, _group, _out_feature_class, _method.GetGPValue(), _tolerance, _precision, _angular_limit];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input features to process.</para>
        /// <para>要处理的输入要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Grouping Field</para>
        /// <para>The field that will be used to determine which features share coincident, non-overlapping boundaries.</para>
        /// <para>将用于确定哪些要素共享重合、非重叠边界的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Grouping Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _group { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class that will be produced.</para>
        /// <para>将生成的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>The method that will be used to regularize the input features.</para>
        ///   <bulletList>
        ///     <bullet_item>Right angles—Identifies the best line segments that fit the input feature vertices along 90° and 180° angles.</bullet_item><para/>
        ///     <bullet_item>Right angles and diagonals—Identifies the best line segments that fit the input feature vertices along 90°, 135°, and 180° interior angles.</bullet_item><para/>
        ///     <bullet_item>Any angles—Identifies the best fit line that falls along any angle while reducing the overall vertex count of the input features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于正则化输入要素的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>直角 - 沿 90° 和 180° 角识别适合输入要素折点的最佳线段。</bullet_item><para/>
        ///     <bullet_item>直角和对角线 - 沿 90°、135° 和 180° 内角识别拟合输入要素折点的最佳线段。</bullet_item><para/>
        ///     <bullet_item>任意角度 - 识别沿任意角度落下的最佳拟合线，同时减少输入要素的整体折点计数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _method_value _method { get; set; } = _method_value._RIGHT_ANGLES;

        public enum _method_value
        {
            /// <summary>
            /// <para>Any angles</para>
            /// <para>Any angles—Identifies the best fit line that falls along any angle while reducing the overall vertex count of the input features.</para>
            /// <para>任意角度 - 识别沿任意角度落下的最佳拟合线，同时减少输入要素的整体折点计数。</para>
            /// </summary>
            [Description("Any angles")]
            [GPEnumValue("ANY_ANGLES")]
            _ANY_ANGLES,

            /// <summary>
            /// <para>Right angles</para>
            /// <para>Right angles—Identifies the best line segments that fit the input feature vertices along 90° and 180° angles.</para>
            /// <para>直角 - 沿 90° 和 180° 角识别适合输入要素折点的最佳线段。</para>
            /// </summary>
            [Description("Right angles")]
            [GPEnumValue("RIGHT_ANGLES")]
            _RIGHT_ANGLES,

            /// <summary>
            /// <para>Right angles and diagonals</para>
            /// <para>Right angles and diagonals—Identifies the best line segments that fit the input feature vertices along 90°, 135°, and 180° interior angles.</para>
            /// <para>直角和对角线 - 沿 90°、135° 和 180° 内角识别拟合输入要素折点的最佳线段。</para>
            /// </summary>
            [Description("Right angles and diagonals")]
            [GPEnumValue("RIGHT_ANGLES_AND_DIAGONALS")]
            _RIGHT_ANGLES_AND_DIAGONALS,

        }

        /// <summary>
        /// <para>Tolerance</para>
        /// <para>The maximum distance that the regularized footprint can deviate from the boundary of its originating feature.</para>
        /// <para>正则化封装可以偏离其原始要素边界的最大距离。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _tolerance { get; set; } = "1 Meters";


        /// <summary>
        /// <para>Precision</para>
        /// <para>The precision of the spatial grid used in the regularization process. Valid values range from 0.05 to 0.25.</para>
        /// <para>正则化过程中使用的空间格网的精度。有效值范围为 0.05 到 0.25。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Precision")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _precision { get; set; } = 0.25;


        /// <summary>
        /// <para>Angular Deviation Limit</para>
        /// <para>The maximum deviation of the best fit line's interior angles that will be tolerated when using the Right Angles and Diagonals (RIGHT_ANGLES_AND_DIAGONALS) method. This value should generally be kept to less than 5° to obtain best results. This parameter is disabled for other regularization methods.</para>
        /// <para>使用直角和对角线 （RIGHT_ANGLES_AND_DIAGONALS） 方法时允许的最佳拟合线内角的最大偏差。该值通常应保持在 5° 以下以获得最佳效果。对于其他正则化方法，此参数处于禁用状态。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Angular Deviation Limit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _angular_limit { get; set; } = 1;


        public RegularizeAdjacentBuildingFootprint SetEnv(object geographicTransformations = null, object outputCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}